# -*- coding: utf-8 -*-
"""
****************************
@Time    : 2021/4/25 17:46
@Author  : Candy
@File    : response.py
****************************
"""


class MyResponse:

    def __init__(self, status='success', code=200, info=None):
        self.status = status
        self.code = code
        self.results = info if info else {"message": ""}

    def data(self):
        pr = {}
        for name in dir(self):
            value = getattr(self, name)
            if not name.startswith('__') and not callable(value):
                pr[name] = value
        return pr
